function drawTrajectory(figNum, totalSequence,sites)

figure(figNum),scatter(sites(:,1), sites(:,2), 5, sites(:,3));

numSequence=size(totalSequence,2);
Ft=[];
X_position=[];
Y_position=totalSequence(:,1);

for i=2:2:(numSequence-3)
    %the three control points
    P=totalSequence(:,i);
    Q=totalSequence(:,(i+1)); 
    R=totalSequence(:,(i+2));
    X_position=[X_position, P];
    Y_position=[Y_position, Q];
    for t=0.01:0.01:1
        Ft=[Ft, (1-t)*(1-t)*P+2*t*(1-t)*Q+t*t*R];
    end
end
X_position=[X_position,R];
Y_position=[Y_position, totalSequence(:,end)];

hold on, plot(Ft(1,:), Ft(2,:));
scatter(X_position(1,:), X_position(2,:), 50,'filled');
scatter(Y_position(1,:), Y_position(2,:),50,'<b');
hold off;

saveas(figNum,num2str(figNum),'jpg');